package com.easyj.admin.sys.service;

import java.util.List;

import com.easyj.admin.db.model.Permission;
import com.easyj.admin.db.model.Role;
import com.easyj.admin.db.model.User;
import com.easyj.base.exception.EasyjException;


public interface RoleService {

   	public List<Role> findList(Role filter);

	public Role findById(Long id);
	
	/**
	 * 查找有此角色的用户
	 * @param roleId
	 * @return
	 */
	public  List<User> findUsersByRoleId(Long roleId);
	public  List<User> findUsersByRoleCode(String rolecode);

	public int  insertEntity(Role entity) throws EasyjException;
	public int  updateEntity(Role entity) throws EasyjException;

	public int  deleteById(Long id) throws EasyjException;
	
	public int  updatePermision(Long id,Long[] permisionIds) throws EasyjException;

	public Role  selectUniqueByUqCode(String code);
	public Role  selectUniqueByUqName(String name);
	
	public  List<Permission> findPermissionsByRoleId(Long roleId);
	
	public  List<Permission> findPermissionsByRoleIds(List<Long> roleIds);
}
